package main

import (
	"fmt"
	"sort"
)

func longestDiverseString(a int, b int, c int) string {
	array := [][]int{{a, 0}, {b, 1}, {c, 2}}
	res := make([]byte, 0)
	for {
		sort.Slice(array, func(i, j int) bool {
			return array[i][0] > array[j][0]
		})
		next := false

		for _, v := range array {
			clen, ch := v[0], v[1]
			if clen <= 0 {
				break
			}
			resLen := len(res)
			chByte := byte(ch + 'a')
			if resLen >= 2 && res[resLen-2] == chByte && res[resLen-1] == chByte {
				continue
			}
			v[0]--
			next = true
			res = append(res, chByte)
			break
		}
		if !next {
			break
		}
	}
	return string(res)
}

func main() {
	fmt.Println(longestDiverseString(1, 1, 7))
}
